<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        /* a {
            user-select: none;
        } */

    </style>
</head>
<body>
    <a class="abc" href="https://baidu.com">链接</a>

    <script>

        // const a = document.querySelector('a');

        // a.addEventListener('click', function (e) {
        //     e.preventDefault();
        //     // e.stopPropagation();
        //     console.log('hello');
        // });

        // 网页中鼠标右键的事件
        // document.addEventListener('contextmenu', function (e) {
        //     e.preventDefault();
        // });

        const VIP = false;

        document.addEventListener('copy', function (e) {
            if (!VIP) {
                e.preventDefault();
                alert('有VIP才能复制');
            }
        });

    </script>
</body>
</html>